// vue.config.js
const path = require('path');

const resolve = dir => path.join(__dirname, dir);
const BASE_URL = process.env.NODE_ENV === 'production'
  ? '/my-app/'
  : '/';

module.exports = {
  publicPath: BASE_URL,
  devServer: {
    port: 8091,
    open: true,
    proxy: {
      '/app': {
        target: 'https://api.xinminghui.com',
        changeOrigin: true,
        ws: true,
        secure: false,
        pathRewrite: {
          '^/app': '/neigou',
        },
      },
    },
  },
  lintOnSave: true,
  configureWebpack: {
    plugins: [],
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'));
  },
  productionSourceMap: false,
};
